import request from '@/utils/request'

export default {
    // 获取文章信息
    getList(query, current = 1, size = 20) {
        return request({
            url: '/article/article/search',
            method: 'post',
            data: {
                ...query,
                current,
                size
            }

        })
    },
    // 通过id查询
    getById(id) {
        return request({
            url: `/article/article/${id}`,
            method: 'get',
        })
    },
    // 获取所有正常状态的分类和标签
    getCategoryAndLabel() {
        return request({
            url: `/article/category/label/list`,
            method: 'get',
        })
    },

    // 审核通过
    auditSuccess(id) {
        return request({
            url: `/article/article/audit/success/${id}`,
            method: 'get',
        })
    },

    // 审核不通过
    auditFail(id) {
        return request({
            url: `/article/article/audit/fail/${id}`,
            method: 'get',
        })
    },
    // 根据ID删除文章
    deleteById(id) {
        return request({
            url: `/article/article/${id}`,
            method: 'delete',

        })
    }
}